﻿@model XHouse.Model.Escenas.Escena

<!-------- Titulo viejo<h2>Create</h2>-->

@{
    ViewBag.Title = "Nueva Escena";
}

<!--CODIGO NUEVO QUE APARECE EL TITULO EN EL CUERPO DE LA PAGINA-->
<div class="row">
    <div class="col-xs-12 col-md-10 col-md-offset-1">
        <div class="page-header">
            <h3>Datos de la nueva escena</h3>
        </div>
        @using (Html.BeginForm(null, null, FormMethod.Post, new {@class = "form-horizontal", @role = "form"}))
        {
            //@Html.ValidationSummary(true)

            if (ViewData.ModelState != null && !ViewData.ModelState.IsValid)
            {
                <div class="alert alert-danger alert-dismissable">
                    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                    @Html.ValidationSummary(false, "Errores:")
                </div>
            }

            <div class="form-group">
                <label for="Nombre" class="col-lg-2 control-label">Nombre</label>
                <div class="col-lg-3">
                    @Html.TextBoxFor(model => model.Nombre, new {@class = "form-control"})
                    @Html.ValidationMessageFor(model => model.Nombre, String.Empty, new {@class = "help-block", @style = "color: red;"})
                </div>
            </div>
            <div class="form-group">
                <label class="col-lg-2 control-label" for="Descripcion">Descripción</label>
                <div class="col-lg-3">
                    @Html.TextBoxFor(model => model.Descripcion, new {@class = "form-control"})
                    @Html.ValidationMessageFor(model => model.Descripcion, String.Empty, new {@class = "help-block", @style = "color: red;"})
                </div>
            </div>
            <div class="form-group">
                <div class="col-lg-offset-2 col-lg-3">
                    <button class="btn btn-primary">Guardar</button>
                    <a class="btn btn-danger" href="@Url.Action("Index")">Cancelar</a>
                </div>
            </div>
        }
        
     </div>
</div>      
<!----------------------FIN DEL CODIGO NUEVO---------------------------------->
<!-------------------------------------------------------->
<!------------------Codigo viejo----------------------------
@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Escena</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.Nombre)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Nombre)
            @Html.ValidationMessageFor(model => model.Nombre)
        </div>

        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}
   </div>
</div>
<div>
    @Html.ActionLink("Back to List", "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
    ----------------fin de codigo viejo------------------->
<!--------------------------------------------------------->